﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork2_2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int[] a = { 2, 4, -2, 5, 6, 4, 6, 8, 1, 9 };
            int sum = 0;
            int max = a[0];
            int min = a[0];
            for (int i = 1; i < 10; i++)
            {
                if (a[i] > max)
                    max = a[i];
                if (a[i] < min)
                    min = a[i];
                sum += a[i];

            }
            Console.WriteLine("数组为:2, 4, -2, 5, 6, 4, 6, 8, 1, 9");
            Console.WriteLine("最大值为：" + max);
            Console.WriteLine("最小值为：" + min);
            Console.WriteLine("平均值为：" + sum/10);
            Console.ReadKey();
        }
    }
}
